package offer.tree;

public class TestTree {

    public static int treeDepth(TreeNode root) {
        if (root == null) {
            return 0;
        }
        return (Math.max(treeDepth(root.left),treeDepth(root.right)) + 1);
    }

    public static void main(String[] args) {
        BinaryTree tree = new BinaryTree();

        TreeNode root = tree.setBinaryTree();
        tree.preSearch(root);
        System.out.println();
        System.out.println(treeDepth(root));
    }

}
